var e = getApp();

Page({
    data: {
        language: "",
        customer_open: !0,
        show1: !1,
        service_QRcode: "",
        service_mobile: "",
        cservice: "",
        level_type: "",
        levelList: [],
        memberInfo: {},
        right: {},
        shopDesc: "",
        name: "",
        balance_recharge: 1
    },
    onLoad: function(e) {
        this.init(), this._getLevelUpData();
        var a = wx.getStorageSync("yz_basic_info"), t = this;
        wx.getSystemInfo({
            success: function(e) {
                "ios" == e.platform ? 0 == a.globalParameter.ios_virtual_pay ? t.setData({
                    is_ios: !0
                }) : 1 == a.globalParameter.ios_virtual_pay && t.setData({
                    is_ios: !1
                }) : t.setData({
                    is_ios: !0
                });
            }
        });
    },
    onReady: function() {
        var e = wx.getStorageSync("langIndex");
        this.setData({
            language: e.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    init: function() {
        this.setData({
            customer_open: !0,
            show1: !1,
            service_QRcode: "",
            service_mobile: ""
        });
    },
    callPhone: function() {
        wx.makePhoneCall({
            phoneNumber: this.data.service_mobile
        });
    },
    closePop: function() {
        this.setData({
            show1: !1
        });
    },
    showPop: function() {
        this.data.customer_open && this.setData({
            show1: !0
        });
    },
    _getLevelUpData: function() {
        var a = this, t = e.getNetAddresss("member.member-level.index");
        e._getNetWork({
            url: t,
            success: function(e) {
                var t = e.data;
                if (1 == t.result) {
                    var o = t.data.data.map(function(e, a, t) {
                        return e;
                    });
                    a.setData({
                        level_type: t.data.level_type,
                        levelList: o,
                        memberInfo: t.data.member_data,
                        right: t.data.member_data.rights ? t.data.member_data.rights : "",
                        shopDesc: t.data.shop_description,
                        name: t.data.shop_set ? t.data.shop_set.name : "",
                        balance_recharge: t.data.balance_recharge
                    }), t.data.shop_set && null != t.data.shop_set && a.setData({
                        customer_open: "1" == t.data.shop_set.customer_open,
                        service_QRcode: t.data.shop_set.service_QRcode,
                        service_mobile: t.data.shop_set.service_mobile,
                        cservice: t.data.shop_set.cservice
                    });
                }
            },
            fail: function(e) {
                console.log(e);
            }
        });
    },
    toService: function() {
        var a = this.data.cservice;
        if (!a || "" == a) return !1;
        wx.navigateTo({
            url: a,
            fail: function(a) {
                e.tips("客服路径错误");
            }
        });
    },
    buy: function(e) {
        var a = e.currentTarget.dataset.goodid;
        wx.navigateTo({
            url: "/packageA/detail_v2/detail_v2?id=" + a
        });
    },
    gotoRightGood: function(e) {
        var a = e.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageB/member/RightGood/RightGood?level_id=" + a
        });
    },
    goChongzhi: function(e) {
        var a = e.currentTarget.dataset.money;
        wx.navigateTo({
            url: "/packageA/member/balance/balance_recharge/balance_recharge?balance=" + a
        });
    }
});